﻿CREATE PROCEDURE [ServiceEngine].[GetBindingElementsForBindingID]
	@BindingID uniqueidentifier
AS
BEGIN
	SET NOCOUNT ON;

	SELECT BBE.BindingID, BBE.BindingElementID,  BBE.ElementOrder, BE.ElementConfig, N.EntityName, N.EntityDescription , BE.ElementType
	FROM [ServiceEngine].Bindings_bindingelements BBE
	JOIN	[ServiceEngine].BindingElements BE on BE.[BindingElementID] = BBE.BindingElementID
	JOIN	[ServiceEngine].Names N on N.[EntityID] = bbe.BindingElementID and N.[EntityTypeID] = 17
	WHERE BBE.BindingId = @BindingID
	ORDER BY BBE.elementOrder asc
	
END


